﻿


/*========================================================================================
//Goodasong -- MySnake
//创建者: 郑雪松
//创建时间：2013年2月26日
//类描述：实体类 Equip_Factory (属性说明自动提取数据库字段的描述信息)
//最后修改者:郑雪松
//最后修改时间:2013年2月26日	
=========================================================================================*/
using System;
using System.Web;
using System.Runtime.Serialization;

namespace COM.PreAlarm.Model
{
    /// <summary>
    /// 实体类 Equip_Factory (属性说明自动提取数据库字段的描述信息)
    /// </summary>
    [Serializable]	  
    [Model(Name = "Equip_Factory", PrimaryKey = "Factory_No", ModelType = ModelType.Table, Condition = "1=1", IsNeedRecordModify = true)]
    public partial class Equip_FactoryInfo : BaseModel
    {
        public Equip_FactoryInfo()
        {            
            PrimaryKey = "Factory_No"; 
			Fields.Add("Factory_No");//设备厂家编号
			Fields.Add("Factory_Name");//厂名
			Fields.Add("Factory_Contrat");//联系人
			Fields.Add("Factory_Telphone");//电话
			Fields.Add("Op_Password");//操作密码
			Fields.Add("EMail");//邮箱地址
			Fields.Add("Ext");//备用字段
			
			
			CanNotNullFields.Add("Factory_No");//设备厂家编号不能为空!				
			
			CanNotNullFields.Add("Factory_Name");//厂名不能为空!				
			
			CanNotNullFields.Add("Factory_Contrat");//联系人不能为空!				
			
			CanNotNullFields.Add("Factory_Telphone");//电话不能为空!				
			
			CanNotNullFields.Add("Op_Password");//操作密码不能为空!				
			this.OnCreated();			
			this.OnModelCreated();
        }
		public Equip_FactoryInfo(bool isNewInfo):this()
        {
			IsNew = isNewInfo;
		}
		#region 方法

        public void OnCreated() { this.SetPrimaryKeyValue(); }		

		public override void SetPrimaryKeyValue()
        {
			
        }
        #endregion 
		
		#region 成员变量
				
		private string _Factory_No;//设备厂家编号
		private string _Factory_Name;//厂名
		private string _Factory_Contrat;//联系人
		private string _Factory_Telphone;//电话
		private string _Op_Password;//操作密码
		private string _EMail;//邮箱地址
		private string _Ext;//备用字段
		
		#endregion
		
		#region 属性 
		
		/// <summary>
        /// 设备厂家编号
        /// </summary>       
		[ModelField(Description = "设备厂家编号", Type = typeof(string), ErrorMessage = "设备厂家编号信息错误!", FieldType = FieldType.Normal, IsKeyField = true,IsUnique = true, IsForeignKey = false, IsAllowNull = false, IsDbGenerated = false, Size = 4,  DbType = "varchar", IsNeedRecordModify = true)]
        public virtual string Factory_No
        {
            get
            {
                return this._Factory_No;
            }
            set
            {
                if (_Factory_No != value || (_Factory_No == null && value == null))
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("Equip_Factory", "Factory_No", _Factory_No, value, "varchar", "设备厂家编号");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnFactory_NoChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._Factory_No = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnFactory_NoChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _Factory_No = value;
                    }
                }
            }
        }
		
		/// <summary>
        /// 厂名
        /// </summary>       
		[ModelField(Description = "厂名", Type = typeof(string), ErrorMessage = "厂名信息错误!", FieldType = FieldType.Normal, IsKeyField = false,IsUnique = false, IsForeignKey = false, IsAllowNull = false, IsDbGenerated = false, Size = 64,  DbType = "varchar", IsNeedRecordModify = true)]
        public virtual string Factory_Name
        {
            get
            {
                return this._Factory_Name;
            }
            set
            {
                if (_Factory_Name != value || (_Factory_Name == null && value == null))
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("Equip_Factory", "Factory_Name", _Factory_Name, value, "varchar", "厂名");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnFactory_NameChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._Factory_Name = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnFactory_NameChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _Factory_Name = value;
                    }
                }
            }
        }
		
		/// <summary>
        /// 联系人
        /// </summary>       
		[ModelField(Description = "联系人", Type = typeof(string), ErrorMessage = "联系人信息错误!", FieldType = FieldType.Normal, IsKeyField = false,IsUnique = false, IsForeignKey = false, IsAllowNull = false, IsDbGenerated = false, Size = 16,  DbType = "varchar", IsNeedRecordModify = true)]
        public virtual string Factory_Contrat
        {
            get
            {
                return this._Factory_Contrat;
            }
            set
            {
                if (_Factory_Contrat != value || (_Factory_Contrat == null && value == null))
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("Equip_Factory", "Factory_Contrat", _Factory_Contrat, value, "varchar", "联系人");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnFactory_ContratChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._Factory_Contrat = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnFactory_ContratChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _Factory_Contrat = value;
                    }
                }
            }
        }
		
		/// <summary>
        /// 电话
        /// </summary>       
		[ModelField(Description = "电话", Type = typeof(string), ErrorMessage = "电话信息错误!", FieldType = FieldType.Normal, IsKeyField = false,IsUnique = false, IsForeignKey = false, IsAllowNull = false, IsDbGenerated = false, Size = 16,  DbType = "varchar", IsNeedRecordModify = true)]
        public virtual string Factory_Telphone
        {
            get
            {
                return this._Factory_Telphone;
            }
            set
            {
                if (_Factory_Telphone != value || (_Factory_Telphone == null && value == null))
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("Equip_Factory", "Factory_Telphone", _Factory_Telphone, value, "varchar", "电话");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnFactory_TelphoneChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._Factory_Telphone = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnFactory_TelphoneChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _Factory_Telphone = value;
                    }
                }
            }
        }
		
		/// <summary>
        /// 操作密码
        /// </summary>       
		[ModelField(Description = "操作密码", Type = typeof(string), ErrorMessage = "操作密码信息错误!", FieldType = FieldType.Normal, IsKeyField = false,IsUnique = false, IsForeignKey = false, IsAllowNull = false, IsDbGenerated = false, Size = 64,  DbType = "varchar", IsNeedRecordModify = true)]
        public virtual string Op_Password
        {
            get
            {
                return this._Op_Password;
            }
            set
            {
                if (_Op_Password != value || (_Op_Password == null && value == null))
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("Equip_Factory", "Op_Password", _Op_Password, value, "varchar", "操作密码");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnOp_PasswordChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._Op_Password = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnOp_PasswordChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _Op_Password = value;
                    }
                }
            }
        }
		
		/// <summary>
        /// 邮箱地址
        /// </summary>       
		[ModelField(Description = "邮箱地址", Type = typeof(string), ErrorMessage = "邮箱地址信息错误!", FieldType = FieldType.Normal, IsKeyField = false,IsUnique = false, IsForeignKey = false, IsAllowNull = true, IsDbGenerated = false, Size = 64,  DbType = "varchar", IsNeedRecordModify = true)]
        public virtual string EMail
        {
            get
            {
                return this._EMail;
            }
            set
            {
                if (_EMail != value || (_EMail == null && value == null))
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("Equip_Factory", "EMail", _EMail, value, "varchar", "邮箱地址");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnEMailChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._EMail = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnEMailChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _EMail = value;
                    }
                }
            }
        }
		
		/// <summary>
        /// 备用字段
        /// </summary>       
		[ModelField(Description = "备用字段", Type = typeof(string), ErrorMessage = "备用字段信息错误!", FieldType = FieldType.Normal, IsKeyField = false,IsUnique = false, IsForeignKey = false, IsAllowNull = true, IsDbGenerated = false, Size = 50,  DbType = "nvarchar", IsNeedRecordModify = true)]
        public virtual string Ext
        {
            get
            {
                return this._Ext;
            }
            set
            {
                if (_Ext != value || (_Ext == null && value == null))
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("Equip_Factory", "Ext", _Ext, value, "nvarchar", "备用字段");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnExtChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._Ext = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnExtChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _Ext = value;
                    }
                }
            }
        }
		#endregion 属性
				  
		#region 属性更改事件
		
		partial void OnFactory_NoChanging(ModifyInfo modifyInfo);//设备厂家编号Factory_No改变之前发生
        partial void OnFactory_NoChanged(ModifyInfo modifyInfo);//设备厂家编号Factory_No改变之后发生
		partial void OnFactory_NameChanging(ModifyInfo modifyInfo);//厂名Factory_Name改变之前发生
        partial void OnFactory_NameChanged(ModifyInfo modifyInfo);//厂名Factory_Name改变之后发生
		partial void OnFactory_ContratChanging(ModifyInfo modifyInfo);//联系人Factory_Contrat改变之前发生
        partial void OnFactory_ContratChanged(ModifyInfo modifyInfo);//联系人Factory_Contrat改变之后发生
		partial void OnFactory_TelphoneChanging(ModifyInfo modifyInfo);//电话Factory_Telphone改变之前发生
        partial void OnFactory_TelphoneChanged(ModifyInfo modifyInfo);//电话Factory_Telphone改变之后发生
		partial void OnOp_PasswordChanging(ModifyInfo modifyInfo);//操作密码Op_Password改变之前发生
        partial void OnOp_PasswordChanged(ModifyInfo modifyInfo);//操作密码Op_Password改变之后发生
		partial void OnEMailChanging(ModifyInfo modifyInfo);//邮箱地址EMail改变之前发生
        partial void OnEMailChanged(ModifyInfo modifyInfo);//邮箱地址EMail改变之后发生
		partial void OnExtChanging(ModifyInfo modifyInfo);//备用字段Ext改变之前发生
        partial void OnExtChanged(ModifyInfo modifyInfo);//备用字段Ext改变之后发生
		
		#endregion		
		public virtual string DetailURI { get; set; }
        public virtual string DetailHTMLURI { get; set; }
		public virtual string ManageEditURI {get; set;}
		public virtual string ManageDetailURI {get; set;}
		public override void OnLoaded()
        {
            base.OnLoaded();	
			DetailURI = ZModel.InitDetailURI("EquipFactory", "Factory_No", Factory_No);
            DetailHTMLURI = ZModel.InitDetailHTMLURI("EquipFactory", "Factory_No", Factory_No);
            ManageEditURI = ZModel.InitMEditURI("EquipFactory", "Factory_No", Factory_No);	
		 	ManageDetailURI = ZModel.InitMDetailURI("EquipFactory", "Factory_No", Factory_No);	
			OnModelLoaded();
        }
		
		partial void OnModelCreated();
        partial void OnModelLoaded();
	}	
}